package org.lex.elec.apps.cad.model;

import org.lex.elec.model.datatype.Phase;

public class LinearLoad extends BaseLoad implements Load {
	private static final double sqrt3 = Math.sqrt(3);

	@Override
	public double getCalculatedCurrent() {
		double calculatedPower = this.getCalculatedPower();
		if (this.getPhase() == Phase.triphase) {
			calculatedPower = calculatedPower / sqrt3;
		}
		return calculatedPower / (this.getVoltage() * this.getPowerFactor());
	}
}
